/*
 ============================================================================
 Name        : mysql_util.h
 Author      : ljf
 Version     :
 Copyright   : Your copyright notice
 Description : heard file for sysinfo.h
 History     : 2020/01/17 init versoin
 ============================================================================
 */
#ifndef __MYSQL_UTIL_H_
#define __MYSQL_UTIL_H_

#include <mysql/mysql.h>

#include "sysinfo.h"
#include "ljf_util.h"


#define TABLE_SYSTEM_INFO_NAME "fa_system_info"
#define TABLE_SYSTEM_INFO_FIELD "`user`, `system`, `nice`, `idle`, `wait`, `hardirq`, `softirq`, `steal` \
, `freeram`, `sharedram`, `bufferram`, `totalram`, `ramusage`, `diskavail`, `disktotal`, `diskusage`, `update_time`"

int init_mysql();
int deinit_mysql();

int add_info(sysInfo_type *s);

int list_info();

void print_mysql_error(const char *msg);
#endif
